package tienda.zapateria.siszap.main;

import org.rx.cr.db.DBA;
import org.rx.cr.util.gui.AdminIntall;
import tienda.zapateria.siszap.seguridad.JF_Loguin;

public class Main {

    public static void main(final String[] args) {
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">        
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Windows".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (Exception ex) {
            java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        // TODO code application logic here
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                DBA.selectMYSQL();
                JF_Loguin acceso = new JF_Loguin();

                AdminIntall adminIntall = new AdminIntall(acceso, "SISZAP");
                acceso.setConfig(adminIntall.getConf());
                adminIntall.setTableTest("zapateria.persona");
                if ((args != null && args.length > 0 && args[0].equals("-s")) || (adminIntall.getConf() == null)) {
                    adminIntall.setVisible(true);
                } else if (acceso.getConfig() != null) {
                    acceso.setVisible(true);
                }
            }
        });
    }
}
